package cz.cvut.fit.mi_paa.abs;

import cz.cvut.fit.mi_paa.knapsack.KnapsackInstance;
import cz.cvut.fit.mi_paa.utils.StopWatch;

import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: milos
 * Date: 19.11.12
 * Time: 23:51
 * To change this template use File | Settings | File Templates.
 */
public abstract class Context {
    protected FileWriter resultWriter;
    protected BufferedReader inputReader;
    protected StopWatch sw;

    protected Context(FileWriter resultWriter, BufferedReader inputReader, StopWatch sw) {
        this.resultWriter = resultWriter;
        this.inputReader = inputReader;
        this.sw = sw;
    }

    public abstract boolean nextInstance() throws IOException;
    public abstract void close() throws IOException;
    public abstract Instance getInstance();

    public FileWriter getResultWriter() {
        return resultWriter;
    }

    public BufferedReader getInputReader() {
        return inputReader;
    }

    public StopWatch getSw() {
        return sw;
    }


}
